You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates mikrotik_routeros_interface_print_terse_without-paging.textfsm, so it parses output from newer RouterOS versions instead of erroring:
Skip the Flags: and Columns: header lines that RouterOS 7 emits before the interface rows (previously these hit ^. -> Error).
Add three new optional values captured from the interface rows: IFNAME, IFINDEX, and INTERFACE_ID (from ifname=, ifindex=, and id=).
Add a trailing (\s+\S+=\S+)* catch-all so any additional unmodeled key=value attributes don't fail the match.
All new values are optional, so existing output continues to parse unchanged.
The reason will be displayed to describe this comment to others. Learn more.
Still working some of this out. I believe there might be different results based on the type of device or the version of routeros. Trying to narrow this down.
Please post the unmodified /interface print terse output. In the repo's real RouterOS capture (mikrotik_routeros_interface_print_detail_01.raw) ifname is the kernel name — ifname="eth0" for name="ether1", ifname="ppp25889" for name="pppoe-out1" — and ifindex differs from id, but in the new fixture ifname matches name and ifindex matches id in every row.
Which RouterOS 7 version prints Flags: and Columns: before the terse rows? No other terse fixture in the repo has them, and every fixture that does is the tabular print form followed by a # header row.
Capture the switch= field. The new catch-all swallows switch=switch1 on row 4, so it never reaches the parsed output.
In the Value block:
Value INTERFACE_ID (\d+)
+Value SWITCH (\S+)
Value LAST_LINK_DOWN_TIME (\S+\s\S+)
And the tail of the Start rule:
- ...(\s+link-downs=${LINK_DOWNS})?(\s+\S+=\S+)*\s*$$ -> Record+ ...(\s+link-downs=${LINK_DOWNS})?(\s+switch=${SWITCH})?(\s+\S+=\S+)*\s*$$ -> Record
Rename IFNAME and IFINDEX. As per docs/dev/data_model.md
Then rename the ifname: and ifindex: keys in all three .yml files.
Decide whether mikrotik_routeros_interface_print_detail.textfsm should expose these fields too. It matches ifname=, ifindex=, and id= without capturing them, so the two interface templates would return different schemas for the same data.
Thanks!
(review written by Claude, modified by me)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates mikrotik_routeros_interface_print_terse_without-paging.textfsm, so it parses output from newer RouterOS versions instead of erroring:
Skip the
Flags:andColumns:header lines that RouterOS 7 emits before the interface rows (previously these hit^. -> Error).Add three new optional values captured from the interface rows:
IFNAME, IFINDEX, and INTERFACE_ID(fromifname=,ifindex=, andid=).Add a trailing
(\s+\S+=\S+)*catch-all so any additional unmodeledkey=valueattributes don't fail the match.All new values are optional, so existing output continues to parse unchanged.